package com.zzx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzx.domain.PermissionApi;
import com.zzx.service.PermissionApiService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (PermissionApi)表服务实现类
 *
 * @author makejava
 * @since 2022-07-31 23:15:10
 */
@Service("permissionApiService")
public class PermissionApiServiceImpl extends ServiceImpl<com.zzx.Mapper.PermissionApiMapper, PermissionApi> implements PermissionApiService {

    /**
     * 通过权限id来查询路径
     * @param id
     * @return
     */
    @Override
    public String getPath(Integer id) {

        LambdaQueryWrapper<PermissionApi> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(PermissionApi::getPsId,id);
//        wrapper.ne(PermissionApi::getPsApiOrder,"");
        PermissionApi one = getOne(wrapper);
//        return one!=null?one.getPsApiPath():null;
        return one.getPsApiPath();
    }
}

